OPC-UA Embedded Server SDK  2.1.0
Memory Allocation Functions

Functions

void * UAServer_Malloc (size_t size)
 
void * UAServer_Calloc (size_t size)
 
void * UAServer_Realloc (void *ptr, size_t size)
 
void UAServer_Free (void *ptr)
 

Detailed Description

Function Documentation

void* UAServer_Malloc ( size_t  size)

Allocate a block of memory from the SDK memory allocation subsystem

If the application needs to perform dynamic memory allocation it can use the SDK memory allocation subsystem rather than a general purpose heap (which in any case may not be available). The allocation must be less than UA_Configuration_Internals_t::MAX_ALLOCATION_SIZE_IN_BYTES specified in the runtime configuration (typically by 8 bytes).

Parameters
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void* UAServer_Calloc ( size_t  size)

Allocate a block of memory from the SDK memory allocation subsystem and zero the block. The allocation must be less than UA_Configuration_Internals_t::MAX_ALLOCATION_SIZE_IN_BYTES specified in the runtime configuration (typically by 8 bytes).

Parameters
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void* UAServer_Realloc ( void *  ptr,
size_t  size 
)

Increase or decrease the size of a previously allocated block of memory from the SDK memory allocation subsystem. The allocation must be less than UA_Configuration_Internals_t::MAX_ALLOCATION_SIZE_IN_BYTES specified in the runtime configuration (typically by 8 bytes).

Parameters
[in]ptrA pointer previously returned by one of the memory allocation routines.
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void UAServer_Free ( void *  ptr)

Free a memory block previously allocated with UAServer_Malloc(), UAServer_Calloc() or UAServer_Realloc().

Parameters
[in]ptrThe pointer previously returned by one of the memory allocation routines.